export default{
  state: {
    status:"matching",//matching表示匹配界面 playing表示对战界面（相当于一个router，切换匹配界面和对战界面）
    socket:null,//存储前后端建立的连接connection
    opponent_username:"",//对手名
    opponent_photo:"",//对手头像
    gamemap:null,//存储游戏地图实例
  },
  getters: {
  },
  mutations: {//成功创建连接时，将连接信息存储到全局变量里面
    updateSocket(state,socket){
      state.socket = socket;
    },
    updateOpponent(state,opponent){ 
      state.opponent_username = opponent.username;
      state.opponent_photo = opponent.photo;
    },
    updateStatus(state,status){
      state.status = status;
    },
    updateGamemap(state,gamemap){ 
      state.gamemap = gamemap;
    }
  },
  actions: {
  },
  modules: {
  }
}
